
<%@ page import="sige.Aluno" %>
<!doctype html>
<html>
	<head>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
		<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
		<meta name="viewport" content="width=device-width, initial-scale=1.0">
		<g:set var="entityName" value="${message(code: 'aluno.label', default: 'Aluno')}" />
		<title><g:message code="default.imprime.label" args="[entityName]" /></title>
		<link rel="shortcut icon" href="${resource(dir: 'images', file: 'favicon.ico')}" type="image/x-icon">
		<link rel="apple-touch-icon" href="${resource(dir: 'images', file: 'favicon.ico')}">
		<link rel="apple-touch-icon" sizes="114x114" href="${resource(dir: 'images', file: 'favicon.ico')}">
        <link rel="stylesheet" href="${resource(dir: 'css', file: 'bootstrap.css')}" type="text/css">
		<link rel="stylesheet" href="${resource(dir: 'css', file: 'bootstrap.min.css')}" type="text/css">
        <r:layoutResources />
	</head>
	<body>
		<div id="print-aluno">
			
			<div >
                <br/>
                <div class="span9">
                <g:render template="dados_do_aluno"/>
                </div>
                
                <!------------------QUEBRA DE PÁGINA-------------------------->
                
                <div style="page-break-after: always"></div>
                <br/>
                <table class="table table-bordered table-condensed">
                    <thead>
                        <tr>
                            <th>
                                <center>
                                    <b><g:message code="pede.matricula.label" default="Matrícula" /></b>
                                </center>
                            </th>
                        </tr>
                    </thead>
                </table>
                <g:each in="${alunoInstance?.matriculas}" status="i" var="contratoInstance">
                    <table class="table table-bordered table-condensed span9">
                        <tbody>
                            <tr>
                                <td>
                                  <div>
                                    <span>
                                        <b><g:message code="turma.ano.label" default="Ano:" /></b>
                                    </span>
                                    <span >${fieldValue(bean: contratoInstance?.turma?.ano, field: "ano")}</span>
                                    <span class="divider"><g:message code="span.divider" /></span>
                                    <span>
                                        <b><g:message code="turma.serie.label" default="Série:" /></b>
                                    </span>
                                    <span >${fieldValue(bean: contratoInstance?.turma?.serie, field: "nome")}</span>
                                    <span >${fieldValue(bean: contratoInstance?.turma, field: "nome")}</span>
                                    <span class="divider"><g:message code="span.divider" /></span>
                                  </div>
                                  <div>
                                    <span>
                                        <b><g:message code="contrato.dataDaMatricula.label" default="Data:" /></b>
                                    </span>
                                    <span >
                                        <g:formatDate date="${contratoInstance?.dataDaMatricula}"/>
                                    </span>
                                    <span class="divider"><g:message code="span.divider" /></span>
                                  </div>
                                  <div>
                                    <span>
                                        <b><g:message code="dadosDoAluno.rua.label" default="Rua" /></b>
                                    </span>
                                    <span >
                                        <g:fieldValue bean="${alunoInstance?.dadosDoAluno}" field="rua"/>
                                        -
                                        <g:fieldValue bean="${alunoInstance?.dadosDoAluno}" field="numero"/>,
                                        <g:fieldValue bean="${alunoInstance?.dadosDoAluno}" field="cidade"/> /
                                        <g:fieldValue bean="${alunoInstance?.dadosDoAluno}" field="estado"/>
                                    </span>
                                  </div>
                                  <div>
                                    <span>
                                        <b><g:message code="dadosDoAluno.bairro.label" default="Bairro" /></b>
                                    </span>
                                    <span >
                                        <g:fieldValue bean="${alunoInstance?.dadosDoAluno}" field="bairro"/>
                                    </span>
                                    <span>
                                        <b><g:message code="aluno.fone.label" default="Fone" /></b>
                                    </span>
                                    <span >
                                        ${fieldValue(bean: contratoInstance?.responsavel, field: "fone")}
                                    </span>
                                  </div>
                                  <br/>
                                  <div align="center">
                                    _____________________________________<br/>
                                    Ass. aluno(a)
                                  </div>
                                  <br/>
                                  <div align="center">
                                    _____________________________________<br/>
                                    Ass. pai ou responsável
                                  </div>
                                </td>
                                <td>
                                  <br/>
                                  <div align="center">
                                    _____________________________________<br/>
                                    Ass. secretário(a)
                                  </div>
                                  <div align="center">
                                    <h5>DESPACHO</h5>
                                  </div>
                                  <br/>
                                  <div align="left">
                                    Em, ___________________________________<br/>
                                  </div>
                                  <br/>
                                  <div align="center">
                                    _______________________________________<br/>
                                    Ass. diretor(a)
                                  </div>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                </g:each>
                
                <!------------------QUEBRA DE PÁGINA-------------------------->
                
                <div style="page-break-after: always"></div>
                <br/>
                <g:each in="${alunoInstance?.matriculas}" status="i" var="contratoInstance">
                    <g:if test="${contratoInstance?.anulacao}">
                    <table class="table table-bordered table-condensed">
                        <thead>
                            <tr>
                                <th>
                                    <center>
                                        <h4>
                                            <g:if test="${contratoInstance?.anulacao.motivo == 'Transferência' }" > 
                                                <g:message code="anulacaoDeMatricula.tranferencia.label" default="Pede Transferência" />
                                            </g:if>
                                            <g:elseif test="${contratoInstance?.anulacao.motivo == 'Cancelamento' }" >
                                                <g:message code="anulacaoDeMatricula.cancelamento.label" default="Pede Cancelamento de Matrícula" />
                                            </g:elseif>
                                        </h4>
                                    </center>
                                </th>
                            </tr>
                        </thead>
                        <tbody>
                            <tr>
                                <td>
                                  <div>
                                    <span>
                                        <b><g:message code="anulacaoDeMatricula.data.label" default="Data:" /></b>
                                    </span>
                                    <span >
                                        <g:formatDate date="${contratoInstance?.anulacao?.data}" />
                                    </span>
                                    <span class="divider"><g:message code="span.divider" /></span>
                                    <span>
                                        <b><g:message code="contrato.serie.label" default="Série:" /></b>
                                    </span>
                                    <span >${fieldValue(bean: contratoInstance?.turma, field: "serie")}</span>
                                    <span class="divider"><g:message code="span.divider" /></span>
                                    <span>
                                        <b><g:message code="anulacaoDeMatricula.ensino.label" default="Ensino:" /></b>
                                    </span>
                                    <span >${fieldValue(bean: contratoInstance?.anulacao, field: "ensino")}</span>
                                    <div class="row">
                                        <div class="span3">
                                          <br/>
                                          <div align="center">
                                            _____________________________________<br/>
                                            Ass. aluno(a)
                                          </div>
                                          <br/>
                                          <div align="left">
                                            Despacho_____________________________<br/>
                                          </div>
                                        </div>
                                        <div class="span3">
                                          <br/>
                                          <div align="center">
                                            _____________________________________<br/>
                                            Ass. pai ou responsável
                                          </div>
                                          <br/>
                                          <div align="center">
                                            _______________________________________<br/>
                                            Ass. diretor(a)
                                          </div>
                                        </div>
                                    </div>
                                  </div>
                                </td>
                            </tr>
                        </tbody>
                    </table>
                    </g:if>
                </g:each>
            </div>
        </div>
	</body>
</html>
